Put NSAutoreleasePool usage around other distributed notification observer methods
[adiumx.git] / Utilities / Localization Utility Scripts / update_adium_from_bundle
blob4b57dd1c034d2f2cba2138ad6dd8100741e7ac74
1 #!/bin/sh
2 ###############
4 # Usage: update_adium_from_bundle SOURCE_BUNDLE_PATH LANGUAGE_NAME
5 # for example:
6 # ~/bin/update_adium_from_bundle Desktop/Adium_French.app French
8 # Set REPO to your Adium repository
10 # This script does not cover new localizations initially; they must first be
11 # added via Xcode
12 ################
13 REPO=~/adium
15 SOURCE=$1
17 ########
18 # Functions
19 ########
21 # Update a nib. First argument is the name of the nib,
22 # with the .nib extension. Second argument is the destination folder.
23 # The nib must already exist in the destination.
24 update_nib()
26 for file in $1/*.nib ; do
27 cp $file $2/$1
28 done
31 # Copy all nibs and other files in the current directory to a given destination
32 loc_copy()
34 find . '(' -name "*.nib" ')' -prune -execdir cp "{}/classes.nib" "$1/{}" ';'
35 find . '(' -name "*.nib" ')' -prune -execdir cp "{}/keyedobjects.nib" "$1/{}" ';'
36 find . '(' -name "*.nib" ')' -prune -execdir cp "{}/objects.xib" "$1/{}" ';'
38 for file in * ; do
39 if [ -f "$file" ] ; then
40 cp "$file" "$1"
42 done
45 silent_pushd()
47 pushd "$1" >/dev/null
50 silent_popd()
52 popd >/dev/null
55 #####
56 # Begin!
57 #####
59 update_language()
61 #first parameter to update_language is the language
62 LANG=$1.lproj
64 echo "+++++ Updating $LANG"
66 silent_pushd "$SOURCE/Contents"
68 silent_pushd "Resources"
69 # Main resources
70 silent_pushd $LANG
71 loc_copy "$REPO/Resources/$LANG"
72 silent_popd
74 # Emoticons
75 if [ -e "Emoticons" ] ; then
76 echo "Emoticons"
77 silent_pushd Emoticons
78 silent_pushd Default.AdiumEmoticonset
79 if [ -e "Resources/$LANG" ] ; then
80 silent_pushd Resources/$LANG
81 cp InfoPlist.strings "$REPO/Resources/Emoticons/Default.AdiumEmoticonSet/Resources/$LANG"
82 silent_popd
84 silent_popd
85 silent_popd
86 else
87 echo "No Emoticons found for $LANG"
90 # Scripts
91 if [ -e "Scripts" ] ; then
92 echo "Scripts"
93 silent_pushd Scripts
94 silent_pushd "System Statistics.AdiumScripts"
95 if [ -e "Resources/$LANG" ] ; then
96 silent_pushd Resources/$LANG
97 cp InfoPlist.strings "$REPO/Resources/Scripts/System Statistics.AdiumScripts/Resources/$LANG"
98 silent_popd
100 silent_popd
101 silent_popd
102 else
103 echo "No Scripts found for $LANG"
105 silent_popd
107 #back to Contents
109 silent_pushd Frameworks
110 echo "Adium Framework"
111 if [ -e "Adium.framework/Versions/A/Resources/$LANG" ] ; then
112 silent_pushd Adium.framework/Versions/A/Resources/$LANG
113 loc_copy "$REPO/Frameworks/Adium Framework/Resources/$LANG"
114 silent_popd
117 #No localized resources
118 #silent_pushd AIHyperlinks.framework/Versions/A/Resources/$LANG
119 # loc_copy "$REPO/Frameworks/AIHyperlinks Framework/Resources/$LANG"
120 #silent_popd
122 echo "AIUtilities.framework"
123 if [ -e "AIUtilities.framework/Versions/A/Resources/$LANG" ] ; then
124 silent_pushd AIUtilities.framework/Versions/A/Resources/$LANG
125 loc_copy "$REPO/Frameworks/AIUtilities Framework/Resources/$LANG"
126 silent_popd
129 #warning: This needs to go upstream...
130 if [ -e "Growl-WithInstaller.framework/Versions/A/Resources/$LANG" ] ; then
131 silent_pushd Growl-WithInstaller.framework/Versions/A/Resources/$LANG
132 loc_copy "$REPO/Frameworks/Growl-WithInstaller.framework/Resources/$LANG"
133 silent_popd
136 #warning: This needs to go upstream...
137 if [ -e "Sparkle.framework/Versions/A/Resources/$LANG" ] ; then
138 silent_pushd Sparkle.framework/Versions/A/Resources/$LANG
139 loc_copy "$REPO/Frameworks/Sparkle.framework/Resources/$LANG"
140 silent_popd
142 silent_popd
144 #back to Contents
146 # Plugins
147 silent_pushd PlugIns
148 if [ -e "Purple.AdiumPlugin/Contents/Frameworks/AdiumLibpurple.framework/Versions/A/Resources/$LANG" ] ; then
149 silent_pushd Purple.AdiumPlugin/Contents/Frameworks/AdiumLibpurple.framework/Versions/A/Resources/$LANG
150 loc_copy "$REPO/Plugins/Purple Service/$LANG"
151 silent_popd
154 if [ -e "WebKit Message View.AdiumPlugin/Contents/Resources/$LANG" ] ; then
155 silent_pushd "WebKit Message View.AdiumPlugin/Contents/Resources/$LANG"
156 loc_copy "$REPO/Plugins/WebKit Message View/$LANG"
157 silent_popd
160 silent_popd
162 #back to Contents
164 silent_pushd Library/Spotlight
165 if [ -e "AdiumSpotlightImporter.mdimporter/Contents/Resources/$LANG" ] ; then
166 silent_pushd AdiumSpotlightImporter.mdimporter/Contents/Resources/$LANG
167 loc_copy "$REPO/Other/Adium Spotlight Importer/$LANG"
168 silent_popd
170 silent_popd
173 if [ "$2" = "all" ] ; then
174 # fr_CA not included
176 for lang in \
177 ca \
178 cs \
179 da \
180 de \
181 en_AU \
182 en_CA \
183 es \
184 fi \
185 fr \
186 is \
187 it \
188 ja \
189 nb \
190 nl \
191 pl \
192 pt_BR \
193 ru \
194 sv \
195 tr \
196 zh_CN \
197 zh_TW \
198 ; do
199 update_language $lang
200 done
201 else
202 update_language $2